package View
{
	import laya.events.Event;
	
	import ui.GameOverUI;
	
	/**
	 * 类描述
	 * @author sixsir
	 * @date 2016-11-26下午9:05:12
	 */
	public class GameOverView extends GameOverUI
	{
		public function GameOverView()
		{
			super();
			
			this.btnRestart.on(Event.CLICK, this, onBtnClick);
		}
		
		private function onBtnClick():void
		{
			this.removeSelf();
			DaDiShu.gameView.removeSelf();	
			Laya.stage.addChild(DaDiShu.gameStartView);
		}
		
		public function setScore(score:int):void
		{
			var data:Object = {};
			for (var i:int = 9; i >= 0; i--) 
			{
				data["item"+i] = {index:Math.floor(score % 10)};
				score /= 10;
			}
			this.boxScore.dataSource = data;
		}
	}
}